<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
		<meta charset="utf-8" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<body>
    <ul class="forminfo" style="margin-top: 20px;">
    	<li><label>发送者</label><div class="label_right">
    		${notify.toUserName}
    	</div></li>
    	<li><label>消息标题</label><input type="text" class="dfinput" maxlength="20" name="title">
    </li>
    <li><label>接收者</label><div class="label_right">
    <input value="${notify.fromId }" type="hidden" name="schoolTeacher">
    		${notify.fromUserName }
    	</div></li>
    	<li><label>消息内容</label><textarea class="long_text long_text2" name="content" maxlength="200"></textarea></li>
	<li><label>&nbsp;</label><input name="" type="button" onclick="submitForm()" class="btn" value="提交"/></li>
    </ul>
    <script type="text/javascript" src="js/jquery-1.7.2.js" ></script>
	<script type="text/javascript" src="js/jquery.tips.js"></script>
	<script type="text/javascript" src="layer/layer.js" ></script>
    <script type="text/javascript">
    function submitForm() {
    	if ($("input[name='title']").val() == "") {
    		showTips($("input[name='title']"), '请填写标题!');
    		return false;
    	}
    	if ($("textarea[name='content']").val() == "") {
    		showTips($("textarea[name='content']"), '请填写内容!');
    		return false;
    	}
    	$.ajax({
    		type: "POST",
    		url: "notify/add_notify.do",
    		data: { schoolTeacher : $("input[name='schoolTeacher']").val(),title:$("input[name='title']").val(),content:$("textarea[name='content']").val()},
    		async: true,
    		dataType: "json",
    		success: function(data) {
    			if("success" == data.result){
    				parent.closeAll();
    		}else {
    			layer.alert('提交失败!', {
    	            skin: 'layer-ext-moon' 
    	        });
    			}
    			}
    		})
    	}
	</script>
</body>

</html>
